package cn.admin.config.common.lang;

public class ClassLoaderUtil {

    public static ClassLoader getContextClassLoader() {

        return Thread.currentThread().getContextClassLoader();

    }

    public static Class<?> loadClass(String name) throws ClassNotFoundException {
        return loadClass(name,getContextClassLoader());
    }

    public static Class<?> loadClass(String className,ClassLoader classLoader) throws ClassNotFoundException {

        if (className == null) {
            return null;
        } else {
            return classLoader == null ? Class.forName(className) :
                    Class.forName(className,true,classLoader);
        }

    }

}
